let singleTitle = "每位操作人员必须做到“三不伤害”原则，下列选项中不属于“三不伤害”的是（ ）。";
let singleOptionArray = ["不伤害自己", "不伤害他人", "不被他人伤害（每位操作人员必须做到“三不伤害”原则下列选项中不属于）", "不伤害设备"];
let singleCount = 295;
let multiTitle = "下列选项中，属于我国建筑从业人员职业道德规范主要内容的有（  ）。";
let multiOptionArray = ["爱岗敬业", "属于我国建筑从业人员职业道德规范主要内容的有-诚实守信", "办事公道", "奉献社会", "谋求私利"];
let multiCount = 137;
let judgeTitle = "对保管条件要求较高的材料，如需要保温、低温、冷冻隔离保管的材料，必须按保管要求，存放在特殊库房内。如汽油、柴油、油漆等必须是低温保管。";
let judgeCount = 184;
let judgeOptionArray = ["正确", "错误"];
let answerArray = ["A","B", "C", "D", "E"];
let multiAnswerArray = ["AD", "BC", "ABC", "ABD", "ABE","BCD", "BCE", "ABCD", "ABCDE", "ABCE", "BCDE"]
let caseTitle = "某区购物中心建设工程项目，施工单位根据工程施工进度安排，本月领用钢筋、水泥、石子等主要材料，价值共100000元，用于生产预制构件，在生产过程中，支付生产人员工资10000元、管理人员工资4000元、办公费1000元。根据背景资料，回答下列问题：社会生产一定量的建筑产品的平均消耗量称作（）。"

function mockListQuestion() {
	let questionList = [];
	let singleList = generateQuestion(singleCount, 0, 'single', '单选题', 0, singleTitle, singleOptionArray, answerArray, answerArray);
	let multiList = generateQuestion(multiCount, 0, 'multiple', '多选题', singleCount, multiTitle, multiOptionArray, answerArray, multiAnswerArray);
	let judgeList = generateQuestion(judgeCount, 0, 'judge', '判断题', singleCount + multiCount, judgeTitle, judgeOptionArray, answerArray, answerArray);
	questionList = [...singleList, ...multiList, ...judgeList];
	let case1List = generateCase(caseTitle);
	let case2List = generateCase(caseTitle);
	let case3List = generateCase(caseTitle);
	questionList = [...questionList, ...case1List, ...case2List, ...case3List]
	
	return questionList;
}

function generateQuestion(questionCount, caseFlag, typeCode, typeName, startIndex, title, optionArray, optionCodeArray,answerArray){
	let questionList = []
	for (let i=0;i<questionCount;i++){
		let item = {};
		item.id = startIndex + i + 1;
		item.caseFlag = caseFlag;
		item.typeCode = typeCode;
		item.typeName = typeName;
		item.content = (item.id) + title;
		let optionList = [];
		for (let j=0;j<optionArray.length;j++) {
			let option = {};
			option.option = optionCodeArray[j];
			option.content = optionArray[j];
			optionList.push(option);
		}
		item.optionList = optionList;
		let answerIndex = i%(optionArray.length);
		item.answer = answerArray[answerIndex];
		questionList.push(item);
	}
	return questionList;
}

function generateCase(caseTitle) {
	let singleList = generateQuestion(2, 1, 'single', '单选题', 0, singleTitle, singleOptionArray, answerArray, answerArray);
	let multiList = generateQuestion(1, 1, 'multiple', '多选题', singleCount, multiTitle, multiOptionArray, answerArray, multiAnswerArray);
	let judgeList = generateQuestion(1, 1, 'judge', '判断题', singleCount + multiCount, judgeTitle, judgeOptionArray, answerArray,answerArray);
	let item = singleList[0];
	item.bgContent = caseTitle;
	let caseList = [...singleList, ...multiList, ...judgeList];
	
	return caseList;
}

export default mockListQuestion

